﻿using System;
using System.Linq;
using System.Text;

namespace LL.Business
{
    public class TransResult
    {
        private Exception _exception;

        public TransResult()
        {
            DataEffected = 0;
        }

        /// <summary>
        /// 是否成功执行
        /// </summary>
        public virtual bool Success { get; set; }

        /// <summary>
        /// 异常
        /// </summary>
        public virtual Exception Exception
        {
            get { return _exception; }
            set
            {
                _exception = value;
                if (Message.IsNullOrEmpty())
                    Message = Exception.Message;
            }
        }

        /// <summary>
        /// 业务消息代码
        /// </summary>
        public virtual int MessageCode { get; set; }

        /// <summary>
        /// 业务消息文本
        /// </summary>
        public virtual string Message { get; set; }

        /// <summary>
        /// 相关数据行数
        /// </summary>
        public virtual int DataEffected { get; set; }

    }
}
